<div class="general-form">
  <fieldset>      
    <% if logged_in? %> <!--logged in-->      
      <legend>User Details</legend>
    <% else %>
      <legend>Register: Enter User Details</legend>
    <% end %>

		<% form_for(@user) do |f| %>
		  <%= f.error_messages %>
		  <% if logged_in? %> <!--logged in-->
			  			
			 	<% if is_admin? %><!--ADMINS ONLY : START-->
				  <div>
					<%= f.label :access, "User Type (1=Admin 0=Normal):" %>
					<%= f.text_field :access, :size => 5 %>
				  </div>
				<% end %><!--ADMINS ONLY : END-->
			
		  <% end %>
			
		  <div>
				<%= f.label :name, "Username:" %>
				<%= f.text_field :name, :size => 50 %>
		  </div>
		  <div>
				<%= f.label :email, "Email:" %>
				<%= f.text_field :email, :size => 50 %>
		  </div>
		  <div>
				<%= f.label :email, "Confirm email:" %>
				<%= f.text_field :email, :size => 50 %>
		  </div>
		  <div>
				<%= f.label :password, "Password:" %>
				<%= f.password_field :password, :size => 50 %>
		  </div>
		  <div>
		  	<%= f.label :password_confirmation, "Confirm password:" %>
			 <%= f.password_field :password_confirmation, :size => 50 %>
		  </div>
		  <p><%= f.submit 'Save' %></p>
			<br />
		<% end %>

		    <% if logged_in? %> <!--logged in-->      
      <% if is_admin? %>
        <%= link_to "View All Users", :action => "index" %> |
      <% end %>
    
    <%= link_to "Home", :controller => "home" %>
    <% end %>
  </fieldset>
</div>
